package com.nice.controller;

import com.nice.Commons;
import com.nice.cache.CacheMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpSession;

@Controller
public class IndexController {
    /**
     * 跳转前端首页
     * @param session
     * @return
     */
    @GetMapping("/index")
    public ModelAndView test(HttpSession session) {
        if (session.getAttribute(Commons.LOGIN_NAME) == null) {
            return new ModelAndView("login.html");

        }else{
            return new ModelAndView("index.html");

        }
    }

    /**
     * 查询导航列表页
     * @return
     */
    @GetMapping("/simpleListhtml")
    public ModelAndView simpleListhtml() {
        return new ModelAndView("simpleList.html");
    }


    /**
     * 即将开发
     * @return
     */
    @GetMapping("/willopenlaterhtml")
    public ModelAndView willopenlaterhtml() {
        return new ModelAndView("willopenlater.html");
    }

    /**
     * 我的
     * @return
     */
    @GetMapping("/myinfohtml")
    public ModelAndView myinfohtml() {
        return new ModelAndView("myinfo.html");
    }
}
